package com.youi.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.youi.common.Common;
import com.youi.common.DelStatus;
import com.youi.dao.CitycodeDao;
import com.youi.entity.Citycode;
import com.youi.service.CitycodeService;

@Service
public class CitycodeServiceImpl extends BaseServiceImpl<Citycode> implements CitycodeService{
		
		private CitycodeDao citycodeDao;
		
		@Autowired
		public void setfaultRecordDao(CitycodeDao citycodeDao){
			this.citycodeDao=citycodeDao;
			super.setBaseDAO(citycodeDao);
		}

		@Override
		public String getCityCodeByCity(String city) {
			// TODO Auto-generated method stub
			Map<String, Object> prams=new HashMap<String, Object>();
			prams.put(Common.DELSTATUS, DelStatus.NODEL);
			prams.put("name", city);
			Citycode citycode=citycodeDao.getObject(prams);
			if (citycode!=null) {
				return citycode.getCode();
			}
			return null;
		}
}